import request from "@/utils/request";



export function doEdit(data) {
  return request({
    url: "/sinohis/pension/sys/user",
    method: "post",
    data,
  });

}
export function search(params) {
  return request({
    url: "/sinohis/pension/sys/user/page/condition",
    method: "get",

    params
  });
}
export function searchList(params) {
  return request({
    url: "/sinohis/pension/sys/user",
    method: "get",

    params
  });
}
export function searchrole(params) {
  return request({
    url: "/sinohis/pension/sys/role/searchUserRole",
    method: "get",

    params
  });
}
export function searchUserRoleByUname(params) {
  return request({
    url: "/sinohis/pension/sys/role/searchUserRoleByUname/"+params.uname,
    method: "get",

    params
  });
}
export function doDelete(params) {
  return request({
    url: "/sinohis/pension/sys/user/"+params.uname,
    method: "DELETE",

  });
}
export function Editor(data) {
  return request({
    url: "/sinohis/pension/sys/user",
    method: "put",
    data,
  });

}
export function resetting(data) {
  return request({
    url: "/sinohis/pension/sys/user/reset/"+data.uname+'/pwd/'+data.newpwd,
    method: "PUT",
        data
  });

}
export function role(params) {
  return request({
    url: "/sinohis/pension/sys/role/page/condition",
    method: "get",

    params
  });
}

export function distribute(data) {
  return request({
    url: "/sinohis/pension/sys/user/assignRolesToUser",
    method: "POST",
    data
  });
}

//禁用用户
export function disable(data) {
  return request({
    url: "/sinohis/pension/sys/user/disable/"+data.uname,
    method: "PUT",
    data
  });

}

//启用用户


export function enable(data) {
  return request({
    url: "/sinohis/pension/sys/user/enable/"+data.uname,
    method: "PUT",
    data
  });

}
